package com.example.designpatterns.state;

/**
 * PendingShipmentState类 - 待发货状态
 * 
 * 实现与待发货状态相关的行为
 */
public class PendingShipmentState implements State {
    @Override
    public void pay(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已支付，请勿重复支付");
    }
    
    @Override
    public void ship(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已发货，等待收货");
        context.setState(new ShippedState());
    }
    
    @Override
    public void receive(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 尚未发货，无法确认收货");
    }
    
    @Override
    public void refund(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 申请退款成功");
        context.setState(new RefundState());
    }
    
    @Override
    public void cancel(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已取消，将退还支付款项");
        context.setState(new CancelledState());
    }
    
    @Override
    public String getDescription() {
        return "待发货";
    }
} 